<?php $this->beginContent('/layouts/main'); ?>
<?php ?>

		<?php 
			

			$propertyTypeCreate = null;
			$propertyTypeManage = null;
			$roleManage = null;
			$groupManage = null;
			$groupControllerRelationManage = null;
			$permissionManage = null;
			$editProfile = null;
			$manageUser = null;
			$createUser = null;
			$manageProfileField = null;
			$createProfileField = null;
			$restaurantList=null;
			$restaurantCreate=null;
			$emailTemplateManage=null;
			$emailTemplateCreate=null;
			$staticPagesManage=null;
			$staticPagesCreate=null;
			$bannerDetailsManage=null;
			$bannerDetailsCreate=null;
			$stateCreate=null;
			$stateList=null;
			$cityCreate=null;
			$cityList=null;
			$suburbCreate=null;
			$suburbList=null;
			$zoneCreate=null;
			$zoneList=null;
			
			if(isset(Yii::app()->params['pvt']))
			{
				if(Yii::app()->params['pvt']=='editProfile')
				{
					$editProfile = array('class'=>'active');
				}
				elseif(Yii::app()->params['pvt']=='roleManage') 
				{
							$roleManage = array('class'=>'active');
				}
				elseif(Yii::app()->params['pvt']=='groupManage') 
				{
							$groupManage = array('class'=>'active');
				}
				elseif(Yii::app()->params['pvt']=='groupControllerRelationManage') 
				{
							$groupControllerRelationManage = array('class'=>'active');
				}
				elseif(Yii::app()->params['pvt']=='permissionManage') 
				{
							$permissionManage = array('class'=>'active');
				}
				elseif(Yii::app()->params['pvt']=='manageUser') 
				{
							$manageUser = array('class'=>'active');
				}
				elseif(Yii::app()->params['pvt']=='createUser') 
				{
							$createUser = array('class'=>'active');
				}
				elseif(Yii::app()->params['pvt']=='manageProfileField') 
				{
							$manageProfileField = array('class'=>'active');
				}
				elseif(Yii::app()->params['pvt']=='createProfileField') 
				{
							$createProfileField = array('class'=>'active');
				}
				elseif(Yii::app()->params['pvt']=='restaurantList') 
				{
						$restaurantList = array('class'=>'active');
				}
				elseif(Yii::app()->params['pvt']=='restaurantCreate') 
				{
						$restaurantCreate = array('class'=>'active');
				}
				elseif(Yii::app()->params['pvt']=='templateList') 
				{
						$emailTemplateManage = array('class'=>'active');
				}
				elseif(Yii::app()->params['pvt']=='templateCreate') 
				{
						$emailTemplateCreate = array('class'=>'active');
				}
				elseif(Yii::app()->params['pvt']=='staticPagesList') 
				{
						$staticPagesManage = array('class'=>'active');
				}
				elseif(Yii::app()->params['pvt']=='staticPagesCreate') 
				{
						$staticPagesCreate = array('class'=>'active');
				}
				elseif(Yii::app()->params['pvt']=='bannerDetailsList') 
				{
						$bannerDetailsManage = array('class'=>'active');
				}
				elseif(Yii::app()->params['pvt']=='bannerDetailsCreate') 
				{
						$bannerDetailsCreate = array('class'=>'active');
				}
				elseif(Yii::app()->params['pvt']=='stateList') 
				{
						$stateList = array('class'=>'active');
				}	
				elseif(Yii::app()->params['pvt']=='stateCreate') 
				{
						$stateCreate = array('class'=>'active');
				}
				elseif(Yii::app()->params['pvt']=='cityList') 
				{
						$cityList = array('class'=>'active');
				}	
				elseif(Yii::app()->params['pvt']=='cityCreate') 
				{
						$cityCreate = array('class'=>'active');
				}
				elseif(Yii::app()->params['pvt']=='suburbList') 
				{
						$suburbList = array('class'=>'active');
				}	
				elseif(Yii::app()->params['pvt']=='suburbCreate') 
				{
						$suburbCreate = array('class'=>'active');
				}
				elseif(Yii::app()->params['pvt']=='zoneList') 
				{
						$zoneList = array('class'=>'active');
				}	
				elseif(Yii::app()->params['pvt']=='zoneCreate') 
				{
						$zoneCreate = array('class'=>'active');
				}					
			}
		
		?>
		<?php 	$menu_item=null;
				$arrProfile=array('profile'=>'profile');
				$arrAccess=array('access'=>'access','role'=>'role','group'=>'group','groupControllerRelation'=>'groupControllerRelation','permission'=>'permission');
				$arrProfileField = array('profileField'=>'profileField','cpanel'=>'cpanel');
				$arrRestaurantManagement=array('restaurantManagement'=>'restaurantManagement');
				$arrEmailTemplate=array('emailTemplate'=>'emailTemplate');
				$arrStaticPages=array('staticPages'=>'staticPages');
				$arrBannerDetails=array('bannerDetails'=>'bannerDetails');
				$arrState=array('locationManagement'=>'locationManagement','state'=>'state','city'=>'city','suburb'=>'suburb','zones'=>'zones');
			if(in_array(Yii::app()->controller->id,$arrRestaurantManagement))
			{
				$menu_item=array(
				array('label'=>'Restaurant List', 'url'=>array("restaurantManagement/index"),'itemOptions'=>$restaurantList),
				array('label'=>'Create Restaurant', 'url'=>array("restaurantManagement/create"),'itemOptions'=>$restaurantCreate,),
				);
			}
			elseif(in_array(Yii::app()->controller->id,$arrEmailTemplate))
			{
				$menu_item=array(
				array('label'=>'Email Template List', 'url'=>array("emailTemplate/index"),'itemOptions'=>$emailTemplateManage),
				array('label'=>'Create Email Template', 'url'=>array("emailTemplate/create"),'itemOptions'=>$emailTemplateCreate,),
				);
			}
			elseif(in_array(Yii::app()->controller->id,$arrStaticPages))
			{
				$menu_item=array(
				array('label'=>'Static Pages List', 'url'=>array("staticPages/index"),'itemOptions'=>$staticPagesManage),
				array('label'=>'Create Static Page', 'url'=>array("staticPages/create"),'itemOptions'=>$staticPagesCreate,),
				);
			}
			elseif(in_array(Yii::app()->controller->id,$arrBannerDetails))
			{
				$menu_item=array(
				array('label'=>'Banners List', 'url'=>array("bannerDetails/index"),'itemOptions'=>$bannerDetailsManage),
				array('label'=>'Create Banner', 'url'=>array("bannerDetails/create"),'itemOptions'=>$bannerDetailsCreate,),
				);
			}
			elseif(in_array(Yii::app()->controller->id,$arrState))
			{
				$menu_item=array(
				array('label'=>'Manage State', 'url'=>array("state/index"),'itemOptions'=>$stateList),
				array('label'=>'Create State', 'url'=>array("state/create"),'itemOptions'=>$stateCreate,),
				array('label'=>'Manage City', 'url'=>array("city/index"),'itemOptions'=>$cityList),
				array('label'=>'Create City', 'url'=>array("city/create"),'itemOptions'=>$cityCreate),
				array('label'=>'Manage Suburb', 'url'=>array("suburb/index"),'itemOptions'=>$suburbList),
				array('label'=>'Create Suburb', 'url'=>array("suburb/create"),'itemOptions'=>$suburbCreate),
				array('label'=>'Manage Zone', 'url'=>array("zones/index"),'itemOptions'=>$zoneList),
				array('label'=>'Create Zone', 'url'=>array("zones/create"),'itemOptions'=>$zoneCreate),
				);
			}
			elseif (in_array(Yii::app()->controller->id,$arrAccess))
			{ 
				$menu_item=array(
				array('label'=>'Role Manage', 'url'=>array("role/managerole"),'itemOptions'=>$roleManage),
				array('label'=>'Group Manage', 'url'=>array("group/managegroup"),'itemOptions'=>$groupManage),
				array('label'=>'Manage Controller', 'url'=>array("groupControllerRelation/managerelation"),'itemOptions'=>$groupControllerRelationManage),
				array('label'=>'Manage Permission', 'url'=>array("/admin/permission/"),'itemOptions'=>$permissionManage),
				);
			
			}
			elseif (in_array(Yii::app()->controller->id,$arrProfile))
			{ 
				$menu_item=array(
				array('label'=>'Edit Profile', 'url'=>array("/admin/profile/edit"),'itemOptions'=>$propertyTypeManage),
				array('label'=>'Change Password', 'url'=>array("/admin/profile/changepassword"),'itemOptions'=>$propertyTypeCreate),
				);
			
			}
			elseif (in_array(Yii::app()->controller->id,$arrProfileField))
			{ 
				$menu_item=array(
				array('label'=>'Manage User', 'url'=>array("cpanel/manage"),'itemOptions'=>$manageUser),		
				array('label'=>'Create New Admin', 'url'=>array("cpanel/create"),'itemOptions'=>$createUser),
				array('label'=>'Manage Profile Field', 'url'=>array("profileField/admin"),'itemOptions'=>$manageProfileField),
				array('label'=>'Create Profile Field', 'url'=>array("profileField/create"),'itemOptions'=>$createProfileField),
				);
			}
		
			if(isset($menu_item) && $menu_item)
			{/*
			$this->beginWidget('zii.widgets.CPortlet', array(
				'title'=>'Operations', 
			));
			$this->widget('zii.widgets.CMenu', array(
				'items'=>$menu_item ,
				'htmlOptions'=>array('class'=>'operations'),
			));
			$this->endWidget();	
			*/}					
		?>
		<?php echo $content; ?>
<?php $this->endContent(); ?>   
   